<typesAndNodeExecutors>

This is a summary of the typesAndNodeExecutors dir,
but there is a lot of useful info there that I may forget to summarize here.

A node is an Object Aray which contains other Arays whose sizes depend on eachother in terms of the * and ^ functions, including virtual Arays between them. A node type has 1 or more iterators which use a bigger set of available functions to define a tree (or acyclic network?) of iterators/virtualArays/Arays/etc.

Nodes are defined by types, which are a specific type of node. For each type, there are usually many nodes (instances) of that type.

The most common Aray types are int (Java type int), flo (Java type double), and node (Java type Object).
Should Arays of java.math.BigDecimal be allowed?

Virtual Arays are like Java's "synthetic methods". They do not have to exist in memory,
but they can be copied to a real Aray in memory. Their main use is to define the sequence
of iterations between an Aray and an iterator (or other pair of things)
whose size functions are very different.
For example, if there is an Aray size x and an iterator size 3*(2^x),
then there should be a virtual Aray v size 2^x and a real iterator size 3*v,
because only 1 operator can be added at a time.

There are only 2 operators for defining Aray size: * is multiply and ^ is power.
Arays can also be defined as constant size or have size between 2 constants.
To simplify definitions with constants/ranges, should constant size c be a range from c to c?

Each iterator is a virtual Aray. If you linearly iterate over the indexs in that Aray, and split that into multiple indexs at each leaf in the tree (or acyclic network?) of iterators, that is how the iteration is defined and how it affects the Arays.
You know its a leaf when you find a IterLeafator (which can iterate over Arays with non-linear sizes by ignoring those and using the result of the size calculation) that says use the current flo (or int or other data type) of the Aray. Each Aray has only 1 current iteration index. No Aray is ever used completely at once, unless it is size 0 or 1.
Example: if there are Arays b, c, and d, and bigger Arays size b*c and c*d, and 3 of those IterLeafators point at the b*c Aray and at the c and d Arays, and an iterator has all 3 of those as leafs, then those 3 Arays will be modified by that root iterator, but it will not modify Aray b because no IterLeafator points at it from that root iterator. Its a way to end recursion before it is forced by the simplest type of Aray (a leaf Aray not defined by * or ^).

Any Aray can be viewed as a virtual Aray, including real Arays in memory, iterators, and views of more complex structures like a heapQueue.

<standardDataStructuresThatUseMultipleArays>
	A heapQueue is 2 int Arays and 1 flo Aray. It updates the ints when any flo changes too much, to always know which flo is maximum and know its index, in log time. All 3 Arays are the same size. The first int Aray defines a binary tree which is complete except for the last level.

	The 2 int Arays of a heapQueue are also a standard structure. They are the same size and point at eachother.
	They are any reordering of indexs, without removing or duplicating any index,
	and both Arays are updated every time an index moves.
	If their names are x and y, then for any index, x[y[index]]==index and y[x[index]]==index.

	The parent/child calculations would be simpler if index 0 of those Arays was ignored. Parent of index x would be x>>1, or no parent if x is 1, or error if x is 0.

	To be consistent, all 3 Arays could be the same size, and parent of index x is ((x+1)>>1)-1, or no parent if x is 0.

	An other option is for parent of index x to be x>>1, and all Arays to ignore index 0, or put their used size in index 0 and not require Arays to always be full, but that would complicate bayesian weight calculations, which are size 2^childCount and use the bitwise & operator when optimized.

	An other option is for parent of index x to be x>>1, or no parent if x is 1, and the int for this node is always at index 0.
	This is the only option that uses all parts of all Arays and uses the fast algorithm for heapQueue and bayes weights,
	and is the best option so far.
	In a heapQueue, the flo pointed at by the int at index 0 would be for this node or whatever node is chosen to not obey the normal rules of the heapQueue. This complicates aligning the flo Aray to other Arays in the node that do not have an unusual node at index 0.

	Maybe both types of heapQueue should be allowed, but the simpler should be created first.

</standardDataStructuresThatUseMultipleArays>

There are 2 types of node recursion and they can be used separately or together.

(Recursion1) Each index in a node can optionally have a parent index, or maybe a parent iterator and a parent index that the iterator has a leaf for. Each index in the node (where there is a virtual Aray etc) has a current iteration index, or maybe thats defined by the current iterator.
Example: If the node type defines index 2 as an Object Aray and index 3 as a virtual Aray whose parent index is 2 (and whose parent iterator is a linear iteration of whats at index 2), then when the iterator iterates over a node n's Object Aray at index 2, which contains nodes of the same type, then n's index 3 becomes the Object Aray of the current child node (from the child list x's index 2).

(Recursion2) During an iteration, use some of the flos given by IterLeafators in a flo function and call some other iterator on the current node of one of this node's Arays being iterated by a IterLeafator. I am not sure exactly how to do this, but virtual Arays in this node should be combined with that recursion if the parent index and parent iterator etc match. Example: A virtual Aray in this node that is a view of a child's flo Aray, should be combined with that real flo Aray in the child when recurse on that child in a compatible iterator. The iterator is not always compatible. It may use different Arays or different iteration order of the same Aray.

This system can be predictable for simple networks and turing complete for others, and that can be calculated before running them to avoid infinite loops from evolved code. Everything can be defined as virtual and created as Arays in memory after that, for maximum flexiblity and self understanding of the system.

Rename "virtual Aray" to "IterLeafator", which combines 2 ideas that were separate.
What are the main things in this part of the Audivolv design?:

Rename all "iterator" to "iter".

Should IterConst and Aray be in the same group?



Iter
	A calculation with 1 input and 1 or more outputs.
	Example: a IterMult with output ranges 3 and 10 outputs 2 and 4 when input is 24 because 24=2*10+4.
	The 3 or 10 could be an Iter instead of a constant size. The 10 could be a IterMult with output ranges 2 and 5.
	SUBTYPES:
		IterEq
			Input and output contain the same info but in different forms. No part is redundant.
			IterEq is simultaneously IterMore and IterLess.
			SUBTYPES:
				IterLeaf
					Is a leaf or points at an Iter thats used as a leaf,
					and prevents recursion from going deeper than that leaf.
					SUBTYPES: ArayThere is only 1 type, but it can point at any type of "Aray or other Iter".
						Aray
							A real Aray in memory that is the size of an Iter. Points at that Iter.
							SUBTYPES: Can be any type, but standard types are int, flo, and Object.
						IterAray
							Points at any 1 Iter which can have any type.
				IterMult
				IterPower
		IterMore
			All outputs together have all info in all inputs together and more.
			Opposite of IterLess.
		IterLess
			All inputs together have all info in all outputs together and more.
			Opposite of IterMore.
		IterNotEq
			[All inputs together and [all outputs together] may each contain info not in the other and may share info.
		IterConst
			Input nothing.
			Represents a constant int size. How to output that?

That Iter tree is not organized. Reorganize below:

There are 3 (or 4?) groups of things, and the only possibilities are relevant to them being empty or nonempty:
InfoIo = Info in input and not in output.
InfoIO = Info in both input and output.
InfoiO = Info in output and not in input.

I do not know if a 4th group should be represented, which contains assumptions:
Infoio = Info thats not in input or output.
Example: size of x and size of y in IterMult of 2 things with sizes x and y.
	Input and/or output has current iteration indexs, but not sizes of the things being iterated over.

[Infoio=0 InfoIo=0 InfoIO=0 InfoiO=0]
	Nothing.
[Infoio=0 InfoIo=0 InfoIO=0 InfoiO=1]
	Constant.
[Infoio=0 InfoIo=0 InfoIO=1 InfoiO=0]
	//Invertible. Can convert between input and output without losing info.
[Infoio=0 InfoIo=0 InfoIO=1 InfoiO=1]
	//Redundize.
	//Can convert between input and output without losing info, but some outputs are not possible.
[Infoio=0 InfoIo=1 InfoIO=0 InfoiO=0]
	Ignore. Input info and do not use it.
[Infoio=0 InfoIo=1 InfoIO=0 InfoiO=1]
	Irrelevant. Inputs and outputs exist and are not known to be relevant to eachother.
[Infoio=0 InfoIo=1 InfoIO=1 InfoiO=0]

[Infoio=0 InfoIo=1 InfoIO=1 InfoiO=1]

[Infoio=1 InfoIo=0 InfoIO=0 InfoiO=0]

[Infoio=1 InfoIo=0 InfoIO=0 InfoiO=1]

[Infoio=1 InfoIo=0 InfoIO=1 InfoiO=0]

[Infoio=1 InfoIo=0 InfoIO=1 InfoiO=1]

[Infoio=1 InfoIo=1 InfoIO=0 InfoiO=0]

[Infoio=1 InfoIo=1 InfoIO=0 InfoiO=1]

[Infoio=1 InfoIo=1 InfoIO=1 InfoiO=0]

[Infoio=1 InfoIo=1 InfoIO=1 InfoiO=1]


That organization is not working either because it does not explain how Infoio interacts with I and O.


Try these groups:
I -equal-> O
I -redundant-> O
O -equal-> I
O -redundant-> I
External -external-> O
O -external-> External


That may include more possibilities, but lets simplify and include only the useful possibilities:

IterLiteral - Has a current size and a min and max size that it may become later. For a constant, min equals max.
	Has outputs and no inputs.
	Is this a type of IterMore?
	Is this an Iter? Should the definition of Iter include being stateless? This is not stateless but could be viewed as stateless while array sizes in nodes are not changing, which is not true in all iterations.
IterInvertible - Can convert between input and output without losing info.
	Is an Iter.
IterMore - All outputs together have all info in all inputs together and more.
	Is an IterInvertible that does out allow all outputs.
	Is an Iter.
IterLess - All inputs together have all info in all outputs together and more.
	Is an IterInvertible that does not allow all inputs.
	Is an Iter.
IterLeaf - Ends recursion at its child, ignoring if the child could recurse deeper or not.
	Has 1 input and 1 output.
	Its only purpose is to check if the type of each iter, during recursion, is IterLeaf.
	Is this an Iter?

Those types of Iter are functions whose inputs and outputs are int.
Other function types are needed for all Java types that a node's arrays can contain.
Example: functions whose input and output are flo.
Example: functions that recurse into nodes, and may use flos as conditions to choose to recurse or not, or maybe to choose to recurse into a different node.
Example: Something that connects Iter to arrays in a node and reads/writes the contents of those arrays during iterating.
Examples: 2 things that implement the recursion quoted below:

[QUOTE]
(Recursion1) Each index in a node can optionally have a parent index, or maybe a parent iterator and a parent index that the iterator has a leaf for. Each index in the node (where there is a virtual Aray etc) has a current iteration index, or maybe thats defined by the current iterator.
Example: If the node type defines index 2 as an Object Aray and index 3 as a virtual Aray whose parent index is 2 (and whose parent iterator is a linear iteration of whats at index 2), then when the iterator iterates over a node n's Object Aray at index 2, which contains nodes of the same type, then n's index 3 becomes the Object Aray of the current child node (from the child list x's index 2).

(Recursion2) During an iteration, use some of the flos given by IterLeafators in a flo function and call some other iterator on the current node of one of this node's Arays being iterated by a IterLeafator. I am not sure exactly how to do this, but virtual Arays in this node should be combined with that recursion if the parent index and parent iterator etc match. Example: A virtual Aray in this node that is a view of a child's flo Aray, should be combined with that real flo Aray in the child when recurse on that child in a compatible iterator. The iterator is not always compatible. It may use different Arays or different iteration order of the same Aray.
[END QUOTE]

Define heirarchy of all types relevant to nodes/functions/mouse/speakers/arrays/etc:
AudivolvType
	Func - Can have different quantity and/or types of inputs and outputs. May not allow all possible inputs and/or outputs.
		Iter - func, input x ints, output y ints
			IterInvertible - quantity of possible input values equals quantity of possible output values
				IterLeaf
				IterMult
				IterPower
			IterMore
				IterLiteral
			IterLess
		Flofunc - func, input x flos, output y flos
			FlofuncMouse
			FlofuncSpeakers
		Obfunc - func, input 1 Object, output 1 Object
	Aray
		Node - constant size Object array which contains arrays. Size is defined by another Node which is the type of this Node.

<question importance=high>
	Should all Funcs (including Iter, Flofunc, and Obfunc) use a stack?
	The stack could be made efficient by using an Object array, a flo array, an int array, and an array for all other standard types.
	There should be 1 stack for each thread.
	These arrays could each have their own int var for size used, or could share an int var and use only 1 of the arrays.
	The stack does not have to be real arrays. It could be virtual.
	All funcs would take 1 parameter: the stack.
	Runtime-compiled code could push and pop less because it would use the Java stack for all calculations except the first and last few.
</question>

<question importance=high>
	If each of these Func types (including Iter, Flofunc, and Obfunc) are a function in a Java object,
	what should the parameters and return value (if any) of that function be?
</question>

<question importance=high>
	How should "virtual" things be represented on the stack?
	Maybe by using "virtual" things instead of recursion, and allowing each node to only be in 1 thread at a time,
	recursion can be simulated as an int array the same size as the node (including the virtual parts).
</question>

</typesAndNodeExecutors>